The present invention relates to a memory control method and apparatus. More particularly, it relates to a processing control method for selecting and freeing a memory area which serves to temporarily store input/output data in a multistation system that is constructed of a master station and a plurality of slave stations connected thereto, each of the slave stations having input/output devices.
In a system of this type, each station is furnished with a processing unit, such as microprocessor, which processes data applied from an input device or delivers processed data to an output device. In general, the data involved in the input or output operation is first stored in a memory called a "buffer memory" and then processed or delivered. Recently, a buffer area is provided at a part of a RAM (Random Access Memory) included in each station and is used for the operation, rather than providing a separate buffer memory.
In this case, the input or output operation necessitates a memory control for obtaining a buffer area of requisite size in the memory in compliance with a request from the input/output device or the processing unit or for freeing a buffer area of certain size. Selecting the buffer area is executed, for example, when data applied from the input device is stored in the buffer area in order to process the data by means of the processing unit. Herein, the memory is searched sequentially from its head address to determine whether or not a blank area exists, whereupon the buffer area as requested is selected. On the other hand, freeing the buffer area is executed in a case where, when a selected buffer area of certain size has become unnecessary for use by one input/output device, the area is freed so as to offer it to another device.
Such memory control, especially the control for selecting the buffer area takes a long time for the reasons that the blank area must be searched sequentially from the head address of the memory, and even when a blank area exists, whether or not an area of requisite size is blank must be successively checked.
In order to overcome such disadvantage, there has been proposed a control method wherein the memory is divided into fixed block sizes, and upon request for selecting a buffer area, a blank block is allotted to the request. In general, however, the size of the block is fixedly set in previous consideration of the largest capacity of a buffer size which might be requested. Accordingly, the block corresponding to the largest capacity is selected even for a request for a buffer area of small capacity. This results in lowering of the efficiency of use of the memory.